local skel = fk.CreateSkill{--定义
  name = "knu__sheju",
  tags = { Skill.Hidden },
}

Fk:loadTranslationTable{--翻译
  ["knu__sheju"] = "慑惧",
  [":knu__sheju"] = "隐匿。当你的体力值变化时，你重铸本回合弃牌堆中未包含的对应花色的所有手牌。",

  ["$knu__sheju1"] = "何故如此，咄咄逼人呐！",
  ["$knu__sheju2"] = "如何无道，枉杀无辜啊！",

}
local U = require "packages/utility/utility"
local DIY = require "packages/diy_utility/diy_utility"

skel:addAcquireEffect(function (self, player, is_start)--DIYU的中央区加入游戏
  player.room:addSkill("#CenterArea")
end)

local on_cost = function (self, event, target, player, data)
    local room = player.room
    if #player:getCardIds("h") == 0 then return end
    local cards = DIY.getCenterCards(room)
    if #cards == 0 then
      event:setCostData(self,{cards = player:getCardIds("h")})
      return true
    end
    local suits = {}
    for _,cid in ipairs(cards) do
      table.insertIfNeed(suits,Fk:getCardById(cid).suit)
    end
    local hands = player:getCardIds("h")
    local tars = player:getCardIds("h")
    for _,cid in ipairs(hands) do
      if table.contains(suits,Fk:getCardById(cid).suit) then
        table.removeOne(tars,cid)
      end
    end
    if #tars > 0 then
      event:setCostData(self,{cards = tars})
      return true
    end
  end
local on_use = function(self, event, target, player, data)
    player.room:recastCard(event:getCostData(self).cards,player,skel.name)
  end


skel:addEffect(U.GeneralAppeared,{
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and player.hp ~= 1
  end,
  on_cost = on_cost,
  on_use = on_use,
})
skel:addEffect(fk.HpChanged, {
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name)
  end,
  on_cost = on_cost,
  on_use = on_use,
})

return skel